#ifndef __XSIP_TRANSACTION_STATE_H__
#define __XSIP_TRANSACTION_STATE_H__
#include "xobject.h"

enum {
	TSX_STATE_SEND_REQUEST = 1,
	TSX_STATE_SEND_RESPONSE,

	TSX_STATE_RECV_REQUEST,
	TSX_STATE_RECV_RESPONSE,

	TSX_STATE_RECV_INVITE,
	TSX_STATE_RECV_REINVITE,

	TSX_STATE_SEND_N_REQUEST,
	TSX_STATE_SEND_N_RESPONSE,

	TSX_STATE_RECV_1_REQUEST,
	TSX_STATE_RECV_N_RESPONSE,

	TSX_STATE_RECV_N_REQUEST,
	TSX_STATE_RECV_1_RESPONSE,

	TSX_STATE_SEND_ACK,
	TSX_STATE_RECV_ACK,

	TSX_STATE_SEND_REQUEST_AGAIN,
	TSX_STATE_SEND_RESPONSE_AGAIN,
	
	TSX_STATE_TIMEOUT,
};
class XSIPTransaction;
class XSIP_API XSIPTransactionState : public XSIPObject {
public:
	XSIPTransactionState();
	virtual ~XSIPTransactionState();

	void setTransaction(XSIPTransaction* transaction);

	virtual int touch();
	virtual void complete();
	virtual void timeout();
	void setState(int state);
	int getState();
protected:
	int m_state;
	XSIPTransaction* m_transaction;
};

#endif